package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.HashMap;
import java.util.Map;

@Mapper
public interface UserMapper {
    /**
     * 通过openId获得用户数据
     * @param openId
     * @return
     */
    @Select("select * from user where openid=#{openId}")
    public User getByOpenId(String openId);

    /**
     * 插入数据
     * @param user
     */
    void insert(User user);

    @Select("select * from user where id=#{userId}")
    User getById(Long userId);

    /**
     * 通过map获取用户个数
     * @param map
     * @return
     */
    Integer getUserStatistics(Map map);
}
